//# sourceURL=http://uMapApp/Module/WorkManageModule/FeatureViewPort
define([
    "mhjs/mhjs"
    , "uMap/uMap"
    , "uEarth/uEarth"
    , "../../UI/Layer"
    , "../../Earth/ViewPort"
], function (
    mhjs,
    uMap,
    uEarth,
    Layer,
    ViewPort
) {

    function FeatureViewPort(option) {

        var _this = this;
        option && _this.OptionToProperties(option);


    }

    var _class = FeatureViewPort;

    mhjs.OptionToPropertiesInterface(_class);
    mhjs.EventInterface(_class);

    Object.defineProperties(_class.prototype, {
        "activeFeatures": {
            get: function () {

            },
            set: function () {

            }
        },
        "hideFeatures"  : {
            get: function () {

            },
            set: function () {

            }
        },
        "showFeatures"  : {
            get: function () {

            },
            set: function () {

            }
        },
        "activeFeature" : {
            get: function () {

            },
            set: function () {

            }
        },
        "hideFeature"   : {
            value: function () {

            }
        },
        "showFeature"   : {
            value: function () {

            }
        },
        "viewport"      : {
            get: function () {

            },
            set: function () {

            }
        },
        "open"          : {
            value: function () {
                if (!this.isOpened) {
                    this.layer && this.layer.open();
                    this.isOpened = true;
                    this.trigger("open");
                }
            }
        },
        "close"         : {
            value: function () {
                if (this.isOpened) {
                    this.layer && this.layer.close();
                    this.isOpened = false;
                    this.trigger("close");
                }
            }
        },
        "toggle"        : {
            value: function () {
                if (this.isOpened) {
                    this.close();
                } else {
                    this.open();
                }
            }
        },
        "active"        : {
            value: function (isActive) {
                var _this = this;

                isActive = (isActive === undefined) || Boolean(isActive);
                _this.isActive = _this.isActive === undefined ? false : _this.isActive;

                if (isActive !== _this.isActive) {

                    if (isActive) {
                        _this.marker.label.fillColor = new uMap.Color(["#ff0"]);
                        _this.marker.billboard.image = _this.app.icons.getIconMarker(_this.icon, true);
                        _this.trigger("active");
                    } else {
                        _this.marker.label.fillColor = new uMap.Color(["#fff"]);
                        _this.marker.billboard.image = _this.app.icons.getIconMarker(_this.icon);
                        _this.trigger("unActive");
                    }

                    _this.isActive = isActive;

                }

            }
        }
    });

    return _class;

});